package com.youth.mq.producer;

import com.youth.mq.MySource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;

/**
 * @ClassName OrderStreamProducer
 * @Description: TODO
 * @Author yjwu
 * @Date 2020/3/14 16:44
 **/
@EnableBinding(MySource.class)
public class OrderStreamProducer {
    @Autowired
    private MySource mySource;

    public void sendMsg(String msg) {
        mySource.output().send(MessageBuilder.withPayload(msg).build());
    }


}
